package com.ks.core.exception;


import lombok.extern.slf4j.Slf4j;

/**
 * 所有业务异常的枚举
 *
 * @author kingdee
 * @date 2019-11-26 下午5:04:51
 */
@Slf4j
public enum BizExceptionEnum implements ServiceExceptionEnum {


    /**
     * 系统（400）
     */
    APPLICATION_ERROR(402, "应用查询失败，没有找到对应的应用"),

    PASSWORD_ERROR(201,"密码错误"),

    REPEAT_SUBMIT(401, "重复提交啦"),

    TOKEN_ERROR(415, "token解析异常"),

    HEADER_ERROR(411, "请求头错误"),

    SESSION_NULL(412, "用户Id为空"),

    SESSION_ERROR(413, "用户Id验证失败"),

    CODE_NOT_VALIDY(110, "验证码无效或已过期"),

    ORG_BASE_ERROR(112,"根组织不可关闭!!!"),

    SIGN_ERROR(414, "签名验证失败"),

    MONEY_ERROR(102, "金额不正确"),

    MOBILE_ERROR(114, "请输入正确的手机号"),

    ACCOUNT_PASSWORD_ERROR(114, "账号或密码错误"),

    TOKEN_EXPIRED(415, "token过期"),

    USER_IS_NULL(115, "用户不存在"),

    TENANT_IS_NULL(117, "当前用户不是本租户的管理员或员工"),

    PARSE_ERROR(416, "解析异常"),

    SERVER_ERROR(500, "系统异常"),

    PARAM_TYPE_ERROR(501, "参数类型错误"),

    PARAM_EMPTY(502, "参数为空"),

    MOBILE_REPEAT(105, "该手机号已经被注册过"),

    USER_NOT_ADMIN(106, "该用户不是管理员"),

    MOBILE_BIND(107,"该手机号已被绑定"),

    CMS_CLASS_DELETE_ERROR(106,"该栏目有下级栏目，无法删除"),

    CMS_CLASS_ERROR(106,"不可添加自己为自己的上级"),

    CMS_CLASS_ADD_ERROR(106,"不可设置自己的下级为自己的上级"),

    CMS_NEW_DELETE_ERROR(106,"该栏目下新闻公告，无法删除"),

    MOBILE_NOT_BIND(108,"该手机号未绑定")

    ;


    BizExceptionEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

    private Integer code;

    private String message;

    @Override
    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
